/*package com.hsnn.medstgmini.base.dict.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;
*//**
 * 
 * @category 剂型字典
 * @author xugp
 * @date 2015年6月9日 下午3:14:21
 *//*
@Entity
@Table(name = "dic_drugform")
public class DicDrugform implements Serializable {

	
	private static final long serialVersionUID = 1L;
	private String formId;
	private String formCode;
	private String formName;
	private int status;
	private Date updDatetime;
	private String updUser;
	private int sortId;
	private DicDrugform father;
	private String fatherDrugformCode;
	private String fatherDrugformName;

	
	@Id
	@Column(name = "form_id")
	public String getFormId() {
		return formId;
	}
	public void setFormId(String formId) {
		this.formId = formId;
	}
	@Column(name = "form_code")
	public String getFormCode() {
		return formCode;
	}
	public void setFormCode(String formCode) {
		this.formCode = formCode;
	}
	@Column(name = "form_name")
	public String getFormName() {
		return formName;
	}
	public void setFormName(String formName) {
		this.formName = formName;
	}
	@Column(name = "status")
	public int getStatus() {
		return status;
	}
	public void setStatus(int status) {
		this.status = status;
	}
	
	@Column(name = "upd_datetime")
	public Date getUpdDatetime() {
		return updDatetime;
	}
	public void setUpdDatetime(Date updDatetime) {
		this.updDatetime = updDatetime;
	}
	@Column(name = "upd_user")
	public String getUpdUser() {
		return updUser;
	}
	public void setUpdUser(String updUser) {
		this.updUser = updUser;
	}
	
	
	@Column(name = "sort_id")
	public int getSortId() {
		return sortId;
	}
	public void setSortId(int sortId) {
		this.sortId = sortId;
	}
	@javax.persistence.ManyToOne(cascade = { CascadeType.ALL })
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "father_id")
	public DicDrugform getFather() {
		return father;
	}
	public void setFather(DicDrugform father) {
		this.father = father;
	}
	@Transient
	public String getFatherDrugformCode() {
		return fatherDrugformCode;
	}
	public void setFatherDrugformCode(String fatherDrugformCode) {
		this.fatherDrugformCode = fatherDrugformCode;
	}
	@Transient
	public String getFatherDrugformName() {
		return fatherDrugformName;
	}
	public void setFatherDrugformName(String fatherDrugformName) {
		this.fatherDrugformName = fatherDrugformName;
	}
	
	
	
	
	
}
*/
package com.hsnn.medstgmini.base.dict.model;

import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Transient;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.NotFound;
import org.hibernate.annotations.NotFoundAction;



/**
 * @category 剂型实体类
 * @author 韩守松
 * @date 2015年6月24日
 */
@Entity
@Table(name="dic_drugform"
)

public class DicDrugform  implements java.io.Serializable {


    // Fields    

     /**
	 * 
	 */
	private static final long serialVersionUID = 1943282413797782976L;
	private String formId;//剂型id
     private String formCode;//剂型编码
     private String formName;//剂型
     private String fatherId;//剂型父id
     private Short status;//状态
     private Timestamp updDatetime;//更新时间
     private String updUser;//更新人
     private Short sortId;//排序
   
     private long count;
 
	private DicDrugform fatherCode;//剂型对象
    

	/** default constructor */
    public DicDrugform() {
    }


	/** minimal constructor */
    public DicDrugform(String formCode, String formName) {
        this.formCode = formCode;
        this.formName = formName;
    }
    
    /** full constructor */
    public DicDrugform(String formCode, String formName, String fatherId, Short status, Timestamp updDatetime, String updUser, Short sortId) {
        this.formCode = formCode;
        this.formName = formName;
        this.fatherId = fatherId;
        this.status = status;
        this.updDatetime = updDatetime;
        this.updUser = updUser;
        this.sortId = sortId;
    }

   
    // Property accessors

    @Id
    @GenericGenerator(name="generator", strategy="uuid")
    @GeneratedValue(generator="generator")
    @Column(name="form_id", unique=true, nullable=false, length=36)

    public String getFormId() {
        return this.formId;
    }
    
    public void setFormId(String formId) {
        this.formId = formId;
    }
    
    @Column(name="form_code", nullable=false, length=10)

    public String getFormCode() {
        return this.formCode;
    }
    
    public void setFormCode(String formCode) {
        this.formCode = formCode;
    }
    
    @Column(name="form_name", nullable=false, length=100)

    public String getFormName() {
        return this.formName;
    }
    
    public void setFormName(String formName) {
        this.formName = formName;
    }
    
    @Column(name="father_id",insertable = false,updatable = false, length=36)

    public String getFatherId() {
        return this.fatherId;
    }
    
    public void setFatherId(String fatherId) {
        this.fatherId = fatherId;
    }
    
    @Column(name="status")

    public Short getStatus() {
        return this.status;
    }
    
    public void setStatus(Short status) {
        this.status = status;
    }
    
    @Column(name="upd_datetime", length=19)

    public Timestamp getUpdDatetime() {
        return this.updDatetime;
    }
    
    public void setUpdDatetime(Timestamp updDatetime) {
        this.updDatetime = updDatetime;
    }
    
    @Column(name="upd_user", length=36)

    public String getUpdUser() {
        return this.updUser;
    }
    
    public void setUpdUser(String updUser) {
        this.updUser = updUser;
    }
    
    @Column(name="sort_id")

    public Short getSortId() {
        return this.sortId;
    }
    
    public void setSortId(Short sortId) {
        this.sortId = sortId;
    }
   

    @ManyToOne(cascade=CascadeType.REFRESH)
    @Fetch(FetchMode.JOIN)
	@NotFound(action=NotFoundAction.IGNORE)
	@JoinColumn(name = "father_id")
	public DicDrugform getFatherCode() {
		return fatherCode;
	}

	public void setFatherCode(DicDrugform fatherCode) {
		this.fatherCode = fatherCode;
	}


    @Transient
    public long getCount() {
		return count;
	}


	public void setCount(long count) {
		this.count = count;
	}

	
}